﻿<UserControl x:Class="DIST.LR.ZHJG.Pgybc.Zbgl_KPI"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:qsf="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls"
    xmlns:input="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"

    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="800">

    <UserControl.Resources>
        <SolidColorBrush Color="#d6d4d4" x:Key="BorderBrush"/>
        <Style TargetType="TextBlock" x:Key="TitleStyle">
            <Setter Property="Foreground" Value="#25a0da" />
            <Setter Property="FontSize" Value="23" />
            <Setter Property="FontFamily" Value="/Telerik.Windows.QuickStartUITheme;component/Fonts/MyriadPro-Light.otf#Myriad Pro Light" />
            <Setter Property="Margin" Value="10 5" />
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="HorizontalAlignment" Value="Center"/>
        </Style>
        <Style TargetType="TextBlock" x:Key="TitleStyleL">
            <Setter Property="Foreground" Value="Green" />
            <Setter Property="FontSize" Value="20" />
            <Setter Property="Margin" Value="20" />
            <Setter Property="FontFamily" Value="/DIST.LR.ZHJG.Utility.Silverlight;component/Fonts/Fonts.zip#Microsoft YaHei"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="HorizontalAlignment" Value="Right"/>
        </Style>
        <Style TargetType="TextBlock" x:Key="TitleStyleR">
            <Setter Property="Foreground" Value="Green" />
            <Setter Property="FontSize" Value="20" />
            <Setter Property="Margin" Value="20" />
            <Setter Property="FontFamily" Value="/DIST.LR.ZHJG.Utility.Silverlight;component/Fonts/Fonts.zip#Microsoft YaHei"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="HorizontalAlignment" Value="Left"/>
        </Style>
        <Style x:Key="RadButtonStyle" TargetType="telerik:RadButton">
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Foreground" Value="Green" />
            <Setter Property="FontFamily" Value="FZHei-B01S" />
            <Setter Property="FontSize" Value="16" />
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="HorizontalContentAlignment" Value="Right"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Padding" Value="3"/>
        </Style>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid Margin="10,5,5,5">
            <Grid.RowDefinitions>
                <RowDefinition Height="0.15*"></RowDefinition>
                <RowDefinition Height="0.15*"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
            </Grid.RowDefinitions>
            <Border BorderBrush="{StaticResource BorderBrush}" BorderThickness="1 1 1 1">
                <TextBlock Text="指 标 配 置" Style="{StaticResource TitleStyle}"/>
            </Border>
            <Border Background="Transparent" BorderBrush="{StaticResource BorderBrush}" BorderThickness="1 0 1 1" Grid.Row="1">
            </Border>
            <Border Background="Transparent" BorderBrush="{StaticResource BorderBrush}" BorderThickness="1 0 1 1" Grid.Row="2">
            </Border>
            <Grid Grid.Row="1" >
                <TextBlock Text="当前位置→指标配置" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBlock>
                <telerik:RadButton x:Name="update" Style="{StaticResource RadButtonStyle}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 20 0">
                    <telerik:RadButton.ContentTemplate>
                        <DataTemplate>
                            <Grid>
                                <TextBlock Text="新增指标"/>
                            </Grid>
                        </DataTemplate>
                    </telerik:RadButton.ContentTemplate>
                </telerik:RadButton>
            </Grid>
            <Grid Grid.Row="2">
                <telerik:RadGridView x:Name="RadGridView1" ItemsSource="{Binding KpiInfo}"               
                AutoGenerateColumns="False" ShowGroupPanel="False"
                CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed"
                VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                ReorderColumnsMode="None" IsReadOnly="True" ShowInsertRow="False" 
                ShowGroupFooters="False" ShowColumnHeaders="True" ShowColumnFooters="False" 
                 SelectionUnit="FullRow" FontSize="13" telerik:Theming.Theme="Metro" GridLinesVisibility="Horizontal" ScrollMode="Deferred">
                    <telerik:RadGridView.Columns>
                        <telerik:GridViewDataColumn Header="指标编号" HeaderTextAlignment="Center" DataMemberBinding="{Binding KPIId}" Width="0.1*"/>
                        <telerik:GridViewDataColumn Header="指标名称" HeaderTextAlignment="Center" DataMemberBinding="{Binding KPIName, Mode=TwoWay}" Width="0.15*">
                            <telerik:GridViewDataColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding KPIName}" />
                                </DataTemplate>
                            </telerik:GridViewDataColumn.CellTemplate>
                            <telerik:GridViewDataColumn.CellEditTemplate>
                                <DataTemplate>
                                    <TextBox Text="{Binding KPIName, Mode=TwoWay}"  />
                                </DataTemplate>
                            </telerik:GridViewDataColumn.CellEditTemplate>
                        </telerik:GridViewDataColumn>
                        <telerik:GridViewDataColumn Header="指标解释" HeaderTextAlignment="Center" DataMemberBinding="{Binding KPIDescption, Mode=TwoWay}" DataFormatString="{}{0:c}" TextAlignment="Right" Width="0.3*">
                            <telerik:GridViewDataColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding KPIDescption}" />
                                </DataTemplate>
                            </telerik:GridViewDataColumn.CellTemplate>
                            <telerik:GridViewDataColumn.CellEditTemplate>
                                <DataTemplate>
                                    <telerik:RadNumericUpDown  Maximum="10000" UpdateValueEvent="PropertyChanged" Value="{Binding KPIDescption, Mode=TwoWay, UpdateSourceTrigger=Explicit}" />
                                </DataTemplate>
                            </telerik:GridViewDataColumn.CellEditTemplate>
                        </telerik:GridViewDataColumn>
                        <telerik:GridViewDataColumn Header="单位" HeaderTextAlignment="Center" DataMemberBinding="{Binding KPIUnit, Mode=TwoWay}" Width="0.1*">
                            <telerik:GridViewDataColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding KPIUnit}"/>
                                </DataTemplate>
                            </telerik:GridViewDataColumn.CellTemplate>
                            <telerik:GridViewDataColumn.CellEditTemplate>
                                <DataTemplate>
                                    <telerik:RadDatePicker 
                                    SelectedDate="{Binding KPIUnit, Mode=TwoWay}" />
                                </DataTemplate>
                            </telerik:GridViewDataColumn.CellEditTemplate>
                        </telerik:GridViewDataColumn>
                        <telerik:GridViewDataColumn Header="来源编号" HeaderTextAlignment="Center" DataMemberBinding="{Binding KPIOriginid, Mode=TwoWay}" Width="0.1*">
                            <telerik:GridViewDataColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding KPIOriginid}" />
                                </DataTemplate>
                            </telerik:GridViewDataColumn.CellTemplate>
                            <telerik:GridViewDataColumn.CellEditTemplate>
                                <DataTemplate>
                                    <telerik:RadDatePicker 
                                    SelectedDate="{Binding KPIOriginid, Mode=TwoWay}" />
                                </DataTemplate>
                            </telerik:GridViewDataColumn.CellEditTemplate>
                        </telerik:GridViewDataColumn>
                        <telerik:GridViewDataColumn Header="类型编号" HeaderTextAlignment="Center" DataMemberBinding="{Binding KPITypeid, Mode=TwoWay}" Width="0.1*">
                            <telerik:GridViewDataColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding KPITypeid}" />
                                </DataTemplate>
                            </telerik:GridViewDataColumn.CellTemplate>
                            <telerik:GridViewDataColumn.CellEditTemplate>
                                <DataTemplate>
                                    <telerik:RadDatePicker 
                                    SelectedDate="{Binding KPITypeid, Mode=TwoWay}" />
                                </DataTemplate>
                            </telerik:GridViewDataColumn.CellEditTemplate>
                        </telerik:GridViewDataColumn>
                        <telerik:GridViewDataColumn Header="操作" HeaderTextAlignment="Center" DataMemberBinding="{Binding Discontinued, Mode=TwoWay}" TextAlignment="Center" Width="0.15*">
                            <telerik:GridViewDataColumn.CellTemplate>
                                <DataTemplate>
                                    <StackPanel x:Name="sp" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
                                        <Button x:Name="notify" Content="修 改" Margin="5 5 5 5" Click="notify_Click"></Button>
                                        <Button x:Name="delete" Content="删 除" Margin="5 5 5 5" Click="delete_Click"></Button>
                                    </StackPanel>                                   
                                </DataTemplate>
                            </telerik:GridViewDataColumn.CellTemplate>
                        </telerik:GridViewDataColumn>
                    </telerik:RadGridView.Columns>
                </telerik:RadGridView>
            </Grid>
        </Grid>
    </Grid>
</UserControl>
